<template>
	<view>
		<u-toast ref="uToast"></u-toast>


		<view class="content u-margin-20 u-padding-20">
			<view class=" u-padding-bottom-20  ">
				<view class="">
					基本信息
				</view>
				<view class="flex u-margin-top-20">
					<view class="">
						商户名称：
					</view>
					<view class="">
						{{merchantInfoDo.merSubName}}
					</view>
				</view>
				<view class="flex u-margin-top-10">
					<view class="">
						商户编号：
					</view>
					<view class="">
						{{merchantNo}}
					</view>
				</view>
				<view class="flex u-margin-top-10">
					<view class="">
						手机号：
					</view>
					<view class="">
						{{merchantInfoDo.mobileNo}}
					</view>
				</view>
				<view class="flex u-margin-top-10">
					<view class="">
						经营地址：
					</view>
					<view class="">
						{{merchantInfoDo.provinceZh}}-{{merchantInfoDo.cityZh}}-{{merchantInfoDo.areaZh}}
					</view>
				</view>
				<view class="flex u-margin-top-10">
					<view class="">
						详细地址：
					</view>
					<view class="">
						{{merchantInfoDo.address}}
					</view>
				</view>
				<view class="flex u-margin-top-10">
					<view class="">
						注册时间：
					</view>
					<view class="">
						{{merchantInfoDo.createTime}}
					</view>
				</view>
				<view class="flex u-margin-top-10">
					<view class="">
						绑定终端：
					</view>
					<view class="">
						{{merchantInfoDo.sn}}
					</view>
				</view>
			</view>

		</view>
		<view class="content u-margin-20 ">
			<u-cell-item :title-style="{ color: '#333333',fontWeight:'bold' }" title="费率信息" :border-bottom="false"
				:arrow="false" class="terminal__sub">

				<image class="icon mr-20" slot="icon" src="@/static/image/home/icon_line_vertical.png" />
			</u-cell-item>
			<view class="content ">
				<view class="u-text-center u-margin-bottom-20 bold">
					刷卡费率
				</view>
				<view class="flex  rate_header">
					<view class="bold flex-1">
						卡类别
					</view>
					<view class="bold flex-1">
						T+1
					</view>
					<view class="bold flex-1">
						T+0
					</view>
					<view class="bold flex-1">
						提现费
					</view>
				</view>
				<view class="flex   rate_item">
					<view class=" flex-1">
						借记卡
					</view>
					<view class=" flex-1">
						{{rateInfo.debitInfo.t1Rate>0?rateInfo.debitInfo.t1Rate+"%(封顶"+rateInfo.debitInfo.t1TopFee+")":"-"}}
					</view>
					<view class=" flex-1">
						{{rateInfo.debitInfo.t0Rate>0?rateInfo.debitInfo.t0Rate+"%":"-"}}
					</view>
					<view class=" flex-1">
						{{rateInfo.debitInfo.cashFee>0?rateInfo.debitInfo.cashFee:"-"}}
					</view>
				</view>

				<view class="flex   rate_item">
					<view class=" flex-1">
						贷记卡
					</view>
					<view class=" flex-1">
						{{rateInfo.creditInfo.t1Rate>0?rateInfo.creditInfo.t1Rate+"%":"-"}}
					</view>
					<view class=" flex-1">
						{{rateInfo.creditInfo.t0Rate>0?rateInfo.creditInfo.t0Rate+"%":"-"}}
					</view>
					<view class=" flex-1">
						{{rateInfo.creditInfo.cashFee>0?rateInfo.creditInfo.cashFee:"-"}}
					</view>
				</view>
			</view>

		</view>
		<view class="content u-margin-20 u-m-t-40 u-p-t-20">
			<view class="u-text-center  u-margin-bottom-20 bold">
				扫码
			</view>
			<view class="flex   rate_header">
				<view class="bold flex-1">
					类别
				</view>
				<view class="bold flex-1">
					T+1
				</view>
				<view class="bold flex-1">
					T+0
				</view>
				<view class="bold flex-1">
					提现费
				</view>
			</view>
			<view class="flex   rate_item">
				<view class=" flex-1">
					支付宝
				</view>
				<view class=" flex-1">
					{{rateInfo.ZFBInfo.t1Rate>0?rateInfo.ZFBInfo.t1Rate+"%":"-"}}
				</view>
				<view class=" flex-1">
					{{rateInfo.ZFBInfo.t0Rate>0?rateInfo.ZFBInfo.t0Rate+"%":"-"}}
				</view>
				<view class=" flex-1">
					{{rateInfo.ZFBInfo.cashFee>0?rateInfo.ZFBInfo.cashFee:"-"}}
				</view>
			</view>
			<view class="flex   rate_item">
				<view class=" flex-1">
					微信
				</view>
				<view class=" flex-1">
					{{rateInfo.WXInfo.t1Rate>0?rateInfo.WXInfo.t1Rate+"%":"-"}}
				</view>
				<view class=" flex-1">
					{{rateInfo.WXInfo.t0Rate>0?rateInfo.WXInfo.t0Rate+"%":"-"}}
				</view>
				<view class=" flex-1">
					{{rateInfo.WXInfo.cashFee>0?rateInfo.WXInfo.cashFee:"-"}}
				</view>
			</view>
			<view class="flex   rate_item">
				<view class=" flex-1">
					银联二维码≤1000
				</view>
				<view class=" flex-1">
					{{rateInfo.YL_CODE_LESSInfo.t1Rate>0?rateInfo.YL_CODE_LESSInfo.t1Rate+"%":"-"}}
				</view>
				<view class=" flex-1">
					{{rateInfo.YL_CODE_LESSInfo.t0Rate>0?rateInfo.YL_CODE_LESSInfo.t0Rate+"%":"-"}}
				</view>
				<view class=" flex-1">
					{{rateInfo.YL_CODE_LESSInfo.cashFee>0?rateInfo.YL_CODE_LESSInfo.cashFee:"-"}}
				</view>
			</view>
			<view class="flex   rate_item">
				<view class=" flex-1">
					银联二维码>1000
				</view>
				<view class=" flex-1">
					{{rateInfo.YL_CODE_MOREInfo.t1Rate>0?rateInfo.YL_CODE_MOREInfo.t1Rate+"%":"-"}}
				</view>
				<view class=" flex-1">
					{{rateInfo.YL_CODE_MOREInfo.t0Rate>0?rateInfo.YL_CODE_MOREInfo.t0Rate+"%":"-"}}
				</view>
				<view class=" flex-1">
					{{rateInfo.YL_CODE_MOREInfo.cashFee>0?rateInfo.YL_CODE_MOREInfo.cashFee:"-"}}
				</view>
			</view>
		</view>
		<view class="content u-margin-20 u-m-t-40 u-p-t-20">
			<view class="u-text-center  u-margin-bottom-20 bold">
				移动支付
			</view>
			<view class="flex   rate_header">
				<view class="bold flex-1">
					类别
				</view>
				<view class="bold flex-1">
					T+1
				</view>
				<view class="bold flex-1">
					T+0
				</view>
				<view class="bold flex-1">
					提现费
				</view>
			</view>
			<view class="flex   rate_item">
				<view class=" flex-1">
					移动支付
				</view>
				<view class=" flex-1">
					{{rateInfo.MOBILE_PAYInfo.t1Rate>0?rateInfo.MOBILE_PAYInfo.t1Rate+"%":"-"}}
				</view>
				<view class=" flex-1">
					{{rateInfo.MOBILE_PAYInfo.t0Rate>0?rateInfo.MOBILE_PAYInfo.t0Rate+"%":"-"}}
				</view>
				<view class=" flex-1">
					{{rateInfo.MOBILE_PAYInfo.cashFee>0?rateInfo.MOBILE_PAYInfo.cashFee:"-"}}
				</view>
			</view>

		</view>
	</view>
</template>

<script>
	export default {
		props: {
			// 声明你需要的属性
			merchantNo: String
		},
		data() {
			return {

				data: {},
				merchantInfoDo: {},
				rateList: [],
				rateInfo: {
					debitInfo: {},
					creditInfo: {},
					ZFBInfo: {},
					WXInfo: {},
					YL_CODE_LESSInfo: {},
					YL_CODE_MOREInfo: {},
					MOBILE_PAYInfo: {}
				}
			}
		},
		mounted() {

			this.queryMerInfo();
		},
		methods: {


			queryMerInfo() {
				const _that = this;
				_that.$zx.order_api.queryMerInfo(_that.merchantNo, "detail").then((data) => {
					console.log("data=" + JSON.stringify(data))

					_that.merchantInfoDo = data.merchantInfoDo;
					_that.rateList = data.merRateList;

					data.merRateList.forEach(function(item, index, array) {

						if (item.payTypeCode == "POS" && item.cardType == "2") {
							//借记卡
							_that.$set(_that.rateInfo, "debitInfo", item);
						}
						if (item.payTypeCode == "POS" && item.cardType == "1") {
							//dai记卡
							_that.$set(_that.rateInfo, "creditInfo", item);
						}
						if (item.payTypeCode == "ZFB") {
							//dai记卡
							_that.$set(_that.rateInfo, "ZFBInfo", item);
						}
						if (item.payTypeCode == "WX") {
							//dai记卡
							_that.$set(_that.rateInfo, "WXInfo", item);
						}
						if (item.payTypeCode == "YL_CODE_LESS") {
							//dai记卡
							_that.$set(_that.rateInfo, "YL_CODE_LESSInfo", item);
						}
						if (item.payTypeCode == "YL_CODE_MORE") {
							//dai记卡
							_that.$set(_that.rateInfo, "YL_CODE_MOREInfo", item);
						}
						if (item.payTypeCode == "MOBILE_PAY") {
							//dai记卡
							_that.$set(_that.rateInfo, "MOBILE_PAYInfo", item);
						}
					});
					console.log("info=" + JSON.stringify(_that.rateInfo))
				});
			},
		},
	}
</script>

<style lang="scss" scoped>
	.title {
		height: 80rpx;
		line-height: 80rpx;
		background-color: #e3eef6;
		color: #9D60FF;
	}

	.content {
		background-color: white;
		border-radius: 20rpx;
	}

	.color {
		color: #9D60FF;
	}

	.icon {
		width: 13rpx;
		height: 36rpx;

	}

	.rate_header {
		border-top-left-radius: 20rpx;
		border-top-right-radius: 20rpx;
		background-color: #e5e5e5;
		height: 80rpx;
		line-height: 80rpx;
		text-align: center;
	}

	.rate_item {
		padding: 20rpx 0;
		text-align: center;


	}
</style>